#include<iostream>
using namespace std;
const int N = 32010;
int tree[N];
int n;
int ans[N];
int lowbit(int x)
{
	return x & (-x);
}
void add(int x)
{
	for (int i = x; i <= N; i+=lowbit(i)) {
		tree[i] += 1;
	}
}
int query(int x)
{
	int sum = 0;
	for (int i = x; i; i -= lowbit(i)) {
		sum += tree[i];
	}
	return sum;
}
int main()
{
	cin >> n;
	for (int i = 0; i < n;i ++ ) {
		int a, b;
		cin >> a >> b;
		a++;
		//cout << query(a)<< " "<< ans[query(a)] << endl;
		ans[query(a)]++;
		add(a);
	}
	for (int i = 0; i < n; i++) {
		cout << ans[i] << endl;
	}
	return 0;
}